using System;

namespace Crawler
{
	/// <summary>
	/// Understands the location of the resource
	/// </summary>
	public class ResourcePath : IResourcePath
	{
		string path;
		public static IResourcePath NO_PATH = NoPath.NO_PATH ;

		public ResourcePath() {
		}

		public ResourcePath(string path) {
			this.path = path;
		}

		public ResourcePath GetPath() {
			return this;
		}

		public override string ToString() {
			return path.ToString();
		}

		public override bool Equals(object obj) {
		 return	((ResourcePath)obj).ToString() == this.ToString() ; 
		}


		/// <summary>
		/// understands a null resource path
		/// </summary>
		class NoPath : IResourcePath {

			public static IResourcePath NO_PATH = new NoPath();
 
			private NoPath() {}
			#region IResourcePath Members

			public ResourcePath GetPath() {
				// TODO:  Add NoPath.GetPath implementation
				return new ResourcePath(""); 
			}

			public string ToString() {
				// TODO:  Add NoPath.ToString implementation
				return "";
			}

			public bool Equals(object obj) {
				// TODO:  Add NoPath.Equals implementation
				return false;
			}

			#endregion

		}


	}
}
